package models

import "gorm.io/gorm"

type Shop struct {
	gorm.Model
	Name  string  `gorm:"type:varchar(30)"`
	Num   int     `gorm:"type:int(11)"`
	Price float64 `gorm:"type:decimal(10,2)"`
}

func (s *Shop) ShopAdd(db *gorm.DB) error {
	return db.Debug().Create(s).Error
}

func (s *Shop) ShopFindById(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).First(s).Error
}
